package com.tarena.lbs.basic.web.thread;

import com.tarena.lbs.common.passport.principle.UserPrinciple;

public class AuthenticationUtil {
    private static final ThreadLocal<UserPrinciple> threadLocal = new ThreadLocal<>();
    //静态方法 保存数据
    public static void save(UserPrinciple value){
        threadLocal.set(value);
    }
    //获取数据
    public static UserPrinciple get(){
        return threadLocal.get();
    }
    //清空数据
    public static void clear(){
        threadLocal.remove();
    }
}
